﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Deixei.Domain;
using Deixei.Domain.Service;
using Deixei.Web.Controllers;
using Deixei.Web.Filters;

namespace Deixei.WebApplication.Controllers
{
    [Authorize]
    [ActionLogFilter]
    public class HomeController : DeixeiController
    {

        private readonly IValuesService _valuesService;

        public HomeController(IValuesService valuesService)
        {
            _valuesService = valuesService;
        }

        [AllowAnonymous]
        public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";

            return View();
        }

        [AllowAnonymous]
        [ActionLogFilter]
        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";
            return View();
        }

        [ActionLogFilter]
        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }

        [AllowAnonymous]
        public ActionResult Test()
        {
            ViewBag.Message = "Test Page.";

            return View();
        }

        [AllowAnonymous]
        [ActionLogFilter]
        public ActionResult Values()
        {
            var viewModel = _valuesService.GetAll();
            return View(viewModel);
        } 
    }
}
